//
//  MVSWebserviceBase.h
//  MoltenCore
//
//  Created by Nicholas Bourey on 2/24/11.
//  Copyright 2011 Molten Visuals. All rights reserved.
//

#import <Foundation/Foundation.h>

@class MVSWebserviceOperation;

@protocol MVSWebserviceDelegate;

@interface MVSWebserviceBase : NSObject {
@private
    NSString *baseURL;
	BOOL asynchronous;
	NSOperationQueue *aSyncQueue;
}
@property (readonly) NSString *baseURL;
@property (assign, nonatomic) BOOL asynchronous;

- (id)initWithBaseURL:(NSString *)aBaseURL;
- (void)addWebserviceOperation:(MVSWebserviceOperation *)op;
- (NSInvocation *)prepareInvocationForObject:(id)object andSelector:(SEL)selector;
- (void)dispatchClient:(id<MVSWebserviceDelegate>)client callbackSelector:(SEL)selector params:(id)firstParam, ...;
- (NSString *)escapeString:(NSString *)str;

@end

@protocol MVSWebserviceDelegate <NSObject>

- (void)serviceDidReceiveError:(MVSWebserviceBase *)service error:(NSError *)error;

@end